package com.service.business.trading.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.service.business.base.dto.LoginUserSession;
import com.service.business.trading.controller.rep.TradingSpotConfigRep;
import com.service.business.trading.controller.rep.TradingSpotOrderPageRep;
import com.service.business.trading.controller.rep.TradingSpotTradeRep;
import com.service.business.trading.controller.req.TradingSpotCreateReq;
import com.service.business.trading.controller.req.TradingSpotPageReq;
import com.service.core.rest.response.CommonPageRep;
import com.service.dao.model.TradingSpotPairs;
import com.service.dao.model.TradingSpotTrades;
import com.service.match.common.entity.SpotOrderVo;
import com.service.match.common.entity.SpotTradeVo;
import com.service.match.common.enums.TradingSpotEnum;
import com.service.dao.model.TradingSpotOrder;

import java.util.Date;
import java.util.List;


/**
 * 币币交易
 *
 * @author xxxx
 * @email xxxx@qq.com
 * @date 2020-02-05 11:10:01
 */
public interface TradingSpotOrderService extends IService<TradingSpotOrder> {

    TradingSpotConfigRep listPairsConfig();

    void createOrder(TradingSpotCreateReq createReq, TradingSpotEnum.TradeType tradeType, LoginUserSession session, TradingSpotPairs spotPairs);

    SpotOrderVo buildMsgVo(TradingSpotOrder spotOrder, Integer tradeType);

    CommonPageRep<TradingSpotOrderPageRep> pageSpot(TradingSpotPageReq pageReq);

    void sendMatchEngineCallback(Integer orderId);

    void updateSpotOrder(SpotOrderVo order, TradingSpotEnum.Status status);

    TradingSpotTrades createdSpotTrade(SpotTradeVo spotTradeVo);

    void applyCancelSpotOrder(String tradeNo);

    TradingSpotOrder getSpotOrderByNo(String tradeNo, Integer memberId);

    void cancelSpotOrder(SpotOrderVo spotOrderVo);

    List<TradingSpotOrder> listByStatusAndTime(TradingSpotEnum.Status status, Date time);

}

